Bensaħas notation
Bensaħas notation is very similar to its rival the Ħasínū notation. Named after Bensaħas Terte Pur "Nevenyad", it was more computer-code-like than Ħasínū. This is why it is the notation that was eventually ported to Meta1. Syntax A move, in most chess variants, is divided into two parts: * Its range, which shows where it can move, and * Its action, which shows what it can do once it's there. For an example: let's take the Wazir, which moves or captures one square in all four orthogonal directions. Its range is "one square in any orthogonal directions", and the action is "move or captures". It's counterpart, the Ferz (moving or capturing one square diagonally in each direction) would have a similar action, but a different range – one square diagonally in each direction. Bensaħas uses this model to describe chess pieces: Action(Range) Or, substituting the names for the definitions: What can the piece do once it's there(where it can move) Example and analysis We shall look at three chess pieces encoded in Bensaħas notation and analyze the code. Example one: FIDE Rook The FIDE rook is a very simple piece. It travels in any orthogonal direction for as long as it pleases. Orthodox Chess:Rook { (n, 15)! } The brackets at the top indicate the name of the piece, as well as the game it appears in. When writing about a piece they can be omitted. As an alternative, just the name of the game may be omitted, which will make the beginning of the code look like this: :Rook {. The infinite direction is indicated by the n. "All orthogonal directions" encode to "15" by adding the values on the table to the right of this paragraph. In this case, North + East + South + West = 1 + 2 + 4 + 8 = 15. The exclamation mark ends the move description for that bracket, and the big curly bracket at the end concludes the description of the piece. Example two: FIDE Pawn If you don't know already, the Pawn has the most complex move in FIDE Chess. It can, on its first move: * Move one square forward, or if the path is clear, two squares, both without capturing; and * Move one square diagonally forwards to capture. After that, it can move: * Move one square forward without capturing; and * Move one square diagonally forwards to capture. * If an adjacent pawn double-moves on its first turn and evades the two squares attacked by the pawn, it may capture it anyway. This is called en passant, for those who don't know. It may also promote into Thus, the code is significantly longer than the Rook's: Orthodox Chess:Pawn { m(2, 1: @M = moved, 1)! m(1, 1)! c(1, 144)! igui(1, 2: @T = E The first line states the name of the game and the name of the piece. What follows is kind of complicated so it is split into several headers. Lines 2 to 4: @ notation The second line introduces the @ notation, which is very important because they act as parameters. Together with more complex functions, they can further describe a piece's move. Here, it says that it may move (the m) two squares (the 2) north (1) given that (:) it has moved (moved) once ("1" is encoded by the 1; the "time" is notated by the @M itself, which stands for at move....) Since m(1, 1) is included by m(2, 1), there's no need for the third line to include a time variable. Same with the third move; the Pawn's capturing movements never changed, there's @ notation used either. Line 5: Thinking laterally What follows is the description of en passant. Fortunately, the laws of Chess are very much like mathematical calculation. In maths (x + y) + z = x + (y + z) ; these are two ways that lead to the same path. So rather than checking whether or not a neighboring pawn has made a double move, we can do this: we give the pawn an extra move called "igui" (Japanese for stationary eating), termed in English as "Rifle capture". This gives the ability for the piece to capture without moving. So let us give the pawn the ability to capture a piece that is directly to the East or West of itself. To make it simple, we'll consider just the East for now. We have to limit that however, because with just igui(1, 2) we can capture anything! So we put several parameters at the end to reduce that power to what we want. First, @T = E